identifier='limitedAngle_outerFading_180';
imSize=[512,512];
indexStruct=get_indexStruct(identifier,imSize);
num_radial=length(indexStruct);


origin=get_origin(imSize);
figure(1);
curvelet=get_curvelet(identifier,imSize,0,0);

for radial=4:num_radial %radial scale
    num_angular=indexStruct(radial);
    for angular=1:num_angular %angular scale

        [curvelet,window_size]=get_curvelet(identifier,imSize,radial,angular);
        cur1=curvelet{1};
        point=curvelet{2};
        cur2=curvelet{3};
        
        subplot(1,3,1);
        imagesc(cur1);
        subplot(1,3,2);      
        cur1(point(1):point(2),point(3):point(4))=cur1(point(1):point(2),point(3):point(4))+2*ones(size(cur2));
        imagesc(cur1);
        subplot(1,3,3);
        imagesc(cur2);
        pause()
    end
end


%%


%test wrapping with fast algo
identifier='limitedAngle_outerFading_180';
imSize=[512,512];
radial=5;
angular=3;

[curvelet,window_size]=get_curvelet(identifier,imSize,radial,angular);
img=curvelet{1};
point=curvelet{2};

subplot(1,3,1)
imagesc(img)
subplot(1,3,2)
img2=get_wrapp_window(img,window_size,point,imSize);
imagesc(img2)
subplot(1,3,3)
%img3=get_wrapp_periodization(img2,imSize);
%imagesc(img3(point(1):point(2),point(3):point(4)));
img3=zeros(imSize);
img3(point(1):point(2),point(3):point(4))=img;
img3=get_wrapp_window(img3,window_size);
imagesc(img3);



